import java.util.Scanner;


public class SumTest {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);
    int a = scanner.nextInt();
    int b = scanner.nextInt();
    System.out.println(sum(a, b));
  }

  private static int sum(int a, int b) {
    int result = 0;
    for (int i = 1; i <= b; i++) {
      result += generate(a, i);
    }
    return result;
  }

  private static int generate(int digit, int count) {
    StringBuilder builder = new StringBuilder();
    for (int i = 0; i < count; i++) {
      builder.append(digit);
    }
    return Integer.parseInt(builder.toString());
  }

}
